Encoding or decoding method and apparatus

ABSTRACT

Embodiments of the present invention provide an encoding or decoding method and apparatus. The method includes: extracting first information in a bitstream; determining a chroma component intra prediction mode according to the first information; when the chroma component intra prediction mode cannot be determined according to the first information, extracting second information in the bitstream; and determining the chroma component intra prediction mode according to the second information, where the first information includes information for indicating whether the chroma component intra prediction mode is a DM mode or an LM mode, the second information is used to indicate a remaining mode as the chroma component intra prediction mode, and the remaining mode is one of available chroma component intra prediction modes other than a mode that may be determined according to the first information.

CROSS-REFERENCE TO RELATED APPLICATIONS

This application is a continuation of U.S. patent application Ser. No.14/317,040, filed on Jun. 27, 2014, which is a continuation of U.S.patent application Ser. No. 14/102,186, filed on Dec. 10, 2013, now U.S.Pat. No. 8,804,827, which is a continuation of International ApplicationNo. PCT/CN2012/080334, filed on Aug. 20, 2012, The InternationalApplication claims priority to Chinese Patent Application No.201210018818.7, filed on Jan. 20, 2012, The afore-mentioned patentapplications are hereby incorporated by reference in their entireties.

TECHNICAL FIELD

The present invention relates to the video image processing field, andin particular, to an encoding or decoding method and apparatus.

BACKGROUND

An existing encoding or decoding technology of video images includes anintra coding technology and an inter coding technology. The intra codingrefers to a technology of compressing and encoding an image contentmerely by using a spatial correlation within an image that is beingencoded currently. The inter coding refers to a technology ofcompressing and encoding a current image by using a temporal correlationbetween the image that is being encoded currently and an encoded image.In order to improve efficiency of image intra coding, the H.264/AVC(Advanced Video Coding, advanced video coding) standard first introducedan intra prediction technology to remove a spatial informationredundancy between the image block that is being encoded currently and aneighboring encoded image block. As a result, unlike earlier intracoding technologies, H.264/AVC needs to perform spatial transformationand entropy encoding only on a prediction differential signal instead ofan original image signal, so as to improve the intra coding efficiency.

A video image signal generally includes one luma component and twochroma components. The HEVC (High Efficiency Video Coding, highefficiency video coding) solution is a new generation video encodingstandardized solution that the International Organization forStandardization is currently working on. It inherits the intraprediction encoding technology of the H.264/AVC standard, and introducesa new intra prediction mode, the LM mode, regarding the chromacomponents. When the LM mode is used, a chroma component predicted valueof an image block is obtained by calculation using a linear model basedon a reconstruction value of resampling a luma component of acorresponding block. Therefore, the LM mode is different from aconventional directional intra prediction mode. It uses a correlationbetween a luma component and a chroma component of an image, and is amethod of predicting a chroma component value by using a luma componentvalue.

The HEVC solution inherits and extends the intra prediction encodingtechnology in the H.264/AVC standard. All available intra predictionmodes for chroma components of an image block form a prediction modeset, which includes the following six prediction modes:

DM mode: performs prediction by using an intra prediction mode of a lumacomponent of a current block as a prediction mode of a chroma component;

LM mode: calculates a predicted value of a chroma component by using avalue of a luma component of a sampling point based on a linear model,where a parameter of the linear model is obtained by calculation basedon a luma component value and a chroma component value of a samplingpoint adjacent to a current block;

DC mode: uses an average value of chroma component values of a samplingpoint adjacent to a current block as a predicted value of a chromacomponent of the current block;

Planar (Planar) mode: calculates a predicted value of a sampling pointof a current block based on an assumption of a spatially linear smoothchange in a value of the sampling point;

Horizontal mode: uses a chroma component value of an adjacent samplingpoint to the left as a predicted value of a chroma component of allsampling points within the same row of a current block; and

Vertical mode: uses a chroma component value of an adjacent abovesampling point as a predicted value of a chroma component of allsampling points within the same column of a current block.

Ina related technology, the foregoing chroma prediction modes use a TU(Truncated Unary, truncated unary) code solution to perform encoding ordecoding, where the encoding or decoding are highly complex, anddecoding efficiency is low.

SUMMARY

Embodiments of the present invention provide an encoding or decodingmethod and apparatus which can reduce encoding or decoding complexity invideo image processing and improve decoding efficiency.

In one aspect, an encoding or decoding method is provided, including:extracting first information in a bitstream; determining a chromacomponent intra prediction mode according to the first information; whenthe chroma component intra prediction mode cannot be determinedaccording to the first information, extracting second information in thebitstream; and determining the chroma component intra prediction modeaccording to the second information, where the first informationincludes information for indicating whether the chroma component intraprediction mode is a DM mode or an LM mode, the second information isused to indicate a remaining mode as the chroma component intraprediction mode, and the remaining mode is one of available chromacomponent intra prediction modes other than a mode that may bedetermined according to the first information.

In another aspect, an encoding or decoding apparatus is provided,including a first extracting unit, a first determining unit, a secondextracting unit, and a second determining unit, where the firstextracting unit is configured to extract first information in abitstream; the first determining unit is configured to determine achroma component intra prediction mode according to the firstinformation extracted by the first extracting unit; the secondextracting unit is configured to, when the first determining unit cannotdetermine the chroma component intra prediction mode according to thefirst information, extract second information in the bitstream; and thesecond determining unit is configured to determine the chroma componentintra prediction mode according to the second information extracted bythe second extracting unit, where the first information includesinformation for indicating whether the chroma component intra predictionmode is a DM mode or an LM mode, the second information is used toindicate a remaining mode as the chroma component intra prediction mode,and the remaining mode is one of available chroma component intraprediction modes other than a mode that may be determined according tothe first information.

The foregoing technical solutions may reduce the encoding information ofa chroma mode and optimize sorting for the information to reduceencoding or decoding steps, thereby reducing encoding or decodingcomplexity and improving decoding efficiency.

BRIEF DESCRIPTION OF THE DRAWINGS

To illustrate the technical solutions in the embodiments of the presentinvention more clearly, the following briefly introduces theaccompanying drawings required for describing the embodiments of thepresent invention. Apparently, the accompanying drawings in thefollowing description show merely some embodiments of the presentinvention, and a person of ordinary skill in the art may still deriveother drawings from these accompanying drawings without creativeefforts.

FIG. 1 is a schematic flowchart of an encoding or decoding methodaccording to an embodiment of the present invention;

FIG. 2 is a schematic flowchart of an encoding or decoding methodaccording to another embodiment of the present invention;

FIG. 3 is a schematic flowchart according to an embodiment of thepresent invention;

FIG. 4 is a schematic flowchart according to another embodiment of thepresent invention;

FIG. 5 is a schematic block diagram of an encoding or decoding apparatusaccording to an embodiment of the present invention; and

FIG. 6 is a schematic block diagram of another encoding or decodingapparatus according to an embodiment of the present invention.

DETAILED DESCRIPTION

The following clearly describes the technical solutions in theembodiments of the present invention with reference to the accompanyingdrawings in the embodiments of the present invention. Apparently, thedescribed embodiments are merely a part rather than all of theembodiments of the present invention. All other embodiments obtained bya person of ordinary skill in the art based on the embodiments of thepresent invention without creative efforts shall fall within theprotection scope of the present invention.

The wording “and/or” in this document merely describes an associationbetween associated objects, indicating that three relationships mayexist, for example, A and/or B may indicate three situations: only Aexists, A and B exist at the same time, and only B exists. In addition,the character “/” in this document usually represents that the formerand later associated objects are in a “or” relationship.

A chroma component in an embodiments of the present invention may referto any chroma component of two chroma components. A DC mode, a verticalmode, a horizontal mode, and a planar mode in a chroma component intraprediction mode set of HEVC are the same as corresponding modes in theH.264/AVC standard in terms of a basic principle, but are different inspecific implementation methods. An LM mode and a DM mode are two newlyadded modes. Besides the prediction modes mentioned above, there is areplacement mode. If the DM mode is the same as one of the remainingprediction modes in a prediction mode set, the replacement mode is usedto replace the chroma prediction mode that is the same as the DM mode,so as to make a new prediction mode set. The DM mode performs predictionby using an intra prediction mode of a luma component of a current blockas a prediction mode of a chroma component. Therefore, the method mayalso equivalently determine whether an intra prediction mode of a lumacomponent is the same as a remaining prediction mode in the predictionmode set. The replacement mode may be a prediction mode that isdifferent from all the modes in the chroma component prediction modeset.

The chroma component prediction mode set may be different in differentembodiments of the present invention. One usable chroma componentprediction mode set includes a DM mode, an LM mode, a DC mode, avertical mode, a horizontal mode, and a planar mode. Another usablechroma component prediction mode set includes a DM mode, a DC mode, avertical mode, a horizontal mode, and a planar mode. Another usablechroma component prediction mode set includes a DM mode, an

LM mode, and a default mode. Another usable chroma component predictionmode set includes a DM mode and a default mode.

The LM mode in the modes mentioned above is an optional technology inthe existing HEVC solution. Under an HE (High Efficiency, highefficiency) encoding configuration condition, the LM mode is included inavailable modes for the chroma component intra prediction mode. In suchcases, the prediction mode set includes six prediction modes. However,under an LC (Low Complexity, low complexity) encoding configurationcondition, the LM mode is not included in available modes for the chromacomponent intra prediction mode. In such cases, the prediction mode setincludes five prediction modes. In the existing HEVC solution, whetherthe LM mode is an available mode is determined according to a binaryflag (flag) in a bitstream.

The chroma encoding solution uses a TU (Truncated Unary) code tobinarize mode information of a current block, and then performs entropyencoding on a binary flag after the binarization by using a CABAC(Context-Adaptive Binary Arithmetic Coding) technology. For example,under an HE configuration condition, the six modes, namely, DM, LM,vertical, horizontal, DC, and planar modes may be presented by a TU codeword 0, 10, 110, 1110, 11110, and 11111, respectively; under an LCconfiguration condition, the five modes, namely, DM, vertical,horizontal, DC, and planar modes may be represented by a TU code word 0,10, 110, 1110, and 1111, respectively. A decoding end determines aprediction mode for a chroma component of a current block according tothe TU code word obtained by parsing.

In fact, the TU code word may be regarded as a group of binary flags inseries. In an entropy encoding or entropy decoding process, whether tocontinue to encode or decode the following binary flags is determinedaccording to a value of each binary flag one by one. In addition, eachbinary flag in the TU code word represents a binarized determination.For example, under an LC encoding configuration condition, a TU codehaving a maximum value 5 is used. That is, the TU code includes amaximum of four binary flags. The first binary flag is used to determinewhether a mode of a current block is a DM mode; the second binary flagis used to determine whether the chroma component prediction mode of thecurrent block is a vertical mode; the third binary flag is used todetermine whether the chroma component prediction mode of the currentblock is a horizontal mode; and the fourth binary flag is used todetermine whether the chroma component prediction mode of the currentblock is a DC mode. If the chroma component prediction mode of thecurrent block is not among the four modes described above, it must be aplanar mode.

When the TU code word is used to encode and decode chroma componentintra prediction mode information, a value of a previous binary flag isthe basis for determining whether to encode or decode a next binaryflag. This conditional encoding or decoding increases complexity ofentropy encoding or entropy decoding.

The DM mode is used with a high probability, which reduces importance ofother modes than the DM mode. Moreover, it is possible that the DM modeis the same as the planar mode, the DC mode, the horizontal mode, or thevertical mode, indicating that a large redundancy exists in a set ofavailable modes, where the redundancy affects efficiency of compressingvideo images.

There are many available modes, where six modes are available under anHE condition, and five modes are available under an LC condition. Thisincreases calculation complexity in a process for an encoding end toselect a mode.

An embodiment of the present invention provides an encoding or decodingmethod to solve the above problem.

FIG. 1 is a schematic flowchart of an encoding or decoding method 10according to an embodiment of the present invention, including thefollowing content.

11. Extract first information in a bitstream.

The first information includes information for indicating whether achroma component intra prediction mode is a DM mode or an LM mode.

12. Determine a chroma component intra prediction mode according to thefirst information.

13. When the chroma component intra prediction mode cannot be determinedaccording to the first information, extract second information in thebitstream.

14. Determine the chroma component intra prediction mode according tothe second information.

The second information is used to indicate a remaining mode of thechroma component intra prediction mode, where the remaining mode is oneof available chroma component intra prediction modes other than a modethat may be determined according to the first information.

The remaining mode may be one of modes in a chroma component intraprediction mode set other than a mode that may be determined accordingto the first information. For example, if the first information is usedto determine whether the chroma component intra prediction mode is a DMmode or an LM mode, the remaining mode may be one of the modes in thechroma component intra prediction mode set other than the DM mode andthe LM mode.

When a luma component intra prediction mode is the same as the chromacomponent intra prediction mode in use, a replacement mode may be usedto replace the chroma component intra prediction mode, where thereplacement mode is one of modes that are different from the modes inthe chroma component intra prediction mode set.

The embodiment of the present invention may reduce the encodinginformation of a chroma mode and optimize sorting for the information toreduce encoding or decoding steps, thereby reducing encoding or decodingcomplexity and improving decoding efficiency.

FIG. 2 is a schematic flowchart of an encoding or decoding method 20according to another embodiment of the present invention, including thefollowing content.

21. Extract first information in a bitstream.

The first information includes information for indicating whether achroma component intra prediction mode is a DM mode or an

LM mode. The first information may include one or two pieces ofsub-information carried by a binary flag. The first information may alsobe carried by a TU code having a maximum value 2.

22. Determine whether a chroma component intra prediction mode is a DMmode according to the first information.

When the chroma component intra prediction mode is determined as the DMmode, that is, a result is “yes”, step 23 is performed and the DM modeis used as the chroma component intra prediction mode.

When it is determined that the chroma component intra prediction mode isnot a DM mode, that is, a result is “no”, alternatively, step 24 isperformed to determine whether a chroma component intra prediction modeset includes an LM mode, where the determining method is the same as theprior art.

When it is determined that the set includes the LM mode, that is, aresult is “yes”, step 25 is performed.

25. Determine whether the chroma component intra prediction mode is anLM mode according to the first information.

When the chroma component intra prediction mode is determined as the LMmode, that is, a result is “yes”, step 26 is performed and the LM modeis used as the chroma component intra prediction mode.

When it is determined that the chroma component intra prediction mode isnot an LM mode, that is, a result is “no”, step 27 is performed.

After step 24 is performed, step 27 may also be performed if it isdetermined that the set does not include the LM mode, that is, a resultis “no”.

27. Extract second information in the bitstream.

28. Determine a remaining mode by using the second information, and usethe remaining mode as the chroma component intra prediction mode.

The remaining mode may be one of modes in a chroma component intraprediction mode set other than a mode that may be determined accordingto the first information. For example, in the embodiment, the firstinformation is used to determine whether the chroma component intraprediction mode is a DM mode or an LM mode; then, the remaining mode maybe any of four modes in the chroma component intra prediction mode setother than the DM mode and the LM mode. The second information may carryencoding information indicating which one the remaining modespecifically is. The encoding information of the four modes may becarried by using an FL code, where a corresponding relationship isestablished between each mode and an FL code.

Step 29: Determine whether the chroma component intra prediction modedetermined in the previous step is the same as a luma component intraprediction mode.

If they are the same, that is, a result is “yes”, step 30 is performedto determine to use a replacement mode as the chroma component intraprediction mode. The replacement mode is one of modes that are differentfrom the modes in the chroma component intra prediction mode set.

If they are different, that is, a result is “no”, step 31 is performedto determine to keep the chroma component intra prediction modeunchanged.

As an implementation method, step 32 may replace steps 27 and 28.

As another implementation method, step 29 is optional, and step 31 maybe directly performed after step 32 or step 28.

32. Use a default mode as the chroma component intra prediction mode,where the default mode is one of predefined luma component intraprediction modes.

In the above technical solutions, with respect to different technologiesthat are used, for example, a method for carrying information, multiplesteps described above may be combined, or one step may be divided andcompleted in multiple steps. The present invention sets no limitthereto. The implementation methods shall fall within the protectionscope of the present invention.

The embodiment of the present invention may reduce the encodinginformation of a chroma mode and optimize sorting for the information toreduce encoding or decoding steps, thereby reducing encoding or decodingcomplexity and improving decoding efficiency.

Both the chroma component intra prediction mode and the luma componentintra prediction mode are about the current block. Therefore, in thefollowing embodiments, they are respectively referred to as a currentblock chroma mode and a current block luma mode for short, whichgenerally may also be respectively referred to as a chroma mode and aluma mode for short. Ina standard, generally, there are more modes in aluma component intra prediction mode set than modes in a chromacomponent intra prediction mode set.

FIG. 3 is a schematic flowchart according to an embodiment 300 of thepresent invention.

In the embodiment of the present invention, a binary flag is used tocarry first information. The first information may include informationfor indicating whether a current block chroma mode is a DM mode by usinga binary flag, which is expressed as DM information.

The first information may also include information for indicatingwhether a current block chroma mode is an LM mode by using a binaryflag, which is expressed as LM information. If the LM mode is not anavailable mode in chroma component intra prediction mode set, abitstream contains no LM information, and an encoding end and a decodingend perform no encoding or decoding operation on LM information.

The second information is used to indicate a remaining mode of thechroma component intra prediction mode, where the remaining mode is oneof available chroma component intra prediction modes other than a modethat may be determined according to the first information. An FL (FixLength, fixed-length) code word having a length of 2 may be used torepresent the second information. The remaining modes may be four modes,that is, vertical, horizontal, DC, and planar modes. For example, FLcode words 00, 01, 10, and 11 may be used to represent the four modes,respectively.

When entropy decoding is performed on the DM information, it is allowedto use no context model or use one context model, and a context modelmay be selected from multiple context models according to encodinginformation of adjacent blocks.

When entropy decoding is performed on the LM information, it is allowedto use no context model or use one context model, and a context modelmay be selected from multiple context models according to encodinginformation of adjacent blocks.

No context model is used when entropy decoding is performed on thesecond information. In other words, a by-pass (equiprobability) mode isused to perform entropy decoding on a bitstream to obtain an FL codeword having a length of 2, and determine the corresponding modedescribed according to the FL code word. This can improve throughput forentropy decoding. The by-pass mode is a binary entropy encoding orentropy decoding mode which does not use a probability model. In otherwords, the by-pass mode assumes an equal probability for a binary flagas 0 or 1 where entropy encoding or entropy decoding is currentlyperformed.

It should be noted that it is the prior art to decode a binary flagwithout using a context model, that is, the by-pass mode in the CABACtechnology. It is the prior art to decode a binary flag by using onecontext model. For example, in a luma intra mode encoding or decodingsolution of HEVC, this entropy decoding method is performed for a firstbinary flag. It is the prior art to select a context model from multiplecontext models according to the encoding information of adjacent blocks.For example, in the HEVC solution, this entropy decoding method is usedfor a skip mode flag (skip flag). Therefore, details of the above threeentropy decoding methods may not be described.

The embodiment 300 includes the following content.

310. Extract DM information from a bitstream by using the entropydecoding method described above. If a current block chroma mode isdetermined as a DM mode according to the DM information, end the modedetermining procedure; otherwise, perform step 320.

320. Extract LM information from the bitstream by using the entropydecoding method described above. If the current block chroma mode isdetermined as an LM mode according to the LM information, end the modedetermining procedure; otherwise, perform step 330.

It should be noted that, if the LM mode is not included in availablemodes for chroma component intra prediction, there is no LM informationin the bitstream. A decoding end does not need to perform a parsingoperation and this step may be skipped. The prior art may be used todetermine whether the LM mode is included in the available modes forchroma component intra prediction.

330. Extract second information from the bitstream by using the entropydecoding method described above. The second information is an FL codeword having a length of 2.

340. Determine remaining mode information according to the secondinformation, and use a remaining mode as a current block chroma mode.

The current block chroma mode is determined according to a correspondingrelationship between the FL code word and the remaining mode. Oneavailable corresponding relationship is described above.

Alternatively, if a current block luma mode is the same as the currentblock chroma mode determined in the remaining modes according to theabove method, a replacement mode is used to replace the current blockchroma mode used in step 340. A mode which is different from modes in achroma component intra prediction mode set may be selected as thereplacement mode. For example, a directional prediction mode fromupper-right to lower-left may be used as the replacement mode. When thecurrent block luma mode is not the same as the current block chroma modedetermined from the remaining modes according to the above method, thecurrent block chroma mode used in step 340 remains unchanged.

After the current block chroma mode is determined, the mode determiningprocedure may be ended.

In addition, in order to remove a redundancy in available predictionmodes for a chroma component, alternatively, the set of availableprediction modes for the chroma component includes only three chromacomponent prediction modes, that is, a DM mode, an LM mode, and adefault mode. In such cases, step 360 may be used to replace steps 330and 340, where other steps remain unchanged. In such cases, it is knownaccording to the previous steps that the current block chroma mode isneither the DM mode nor the LM mode. The default mode may be one ofpredefined luma component intra prediction modes.

350. If the current block luma mode is the same as the current blockchroma mode, use a replacement mode to replace the current block chromamode.

360. Use a default mode as the current block chroma mode.

The embodiment of the present invention may reduce the encodinginformation of a chroma mode and optimize sorting for the information toreduce encoding or decoding steps, thereby reducing encoding or decodingcomplexity and improving decoding efficiency.

FIG. 4 is a schematic flowchart according to another embodiment 40 ofthe present invention. The difference from the embodiment 300 lies inthat a TU code word having a maximum value 2 is used to carry firstinformation, which is used to indicate whether a current block chromamode is a DM mode or an LM mode. The TU code word may be 0, 10, and 11.The three code words may respectively indicate that the current blockchroma mode is a DM mode, that the current block chroma mode is an LMmode, and that the current block chroma mode is neither the DM mode northe LM mode, that is, the current block is one in a remaining mode set.It should be noted that if the LM mode is not included in availablemodes for chroma component intra prediction, the TU code word may berolled back to a binary flag, where the binary flag indicates whetherthe current block chroma mode is a DM mode.

Similarly, an FL (Fix Length, fixed-length) code word having a length of2 is used to carry second information to represent a remaining mode in achroma prediction mode. Other aspects, for example, an entropy decodingmethod, are the same as the embodiment 300.

41. Determine a current block chroma mode by extracting a TU code wordindicating whether the current block chroma mode is a DM mode or an LMmode.

The entropy decoding method described in the embodiment 300 is used toextract a TU code word having a maximum value 2 from a bitstream. If thecurrent block chroma mode is determined as a DM mode according to the TUcode word, end the mode determining procedure; if the current blockchroma mode is determined as an LM mode according to the TU code word,end the mode determining procedure; otherwise, the current block chromamode is determined neither as the DM mode nor as the LM mode accordingto the TU code word, and step 42 is performed.

It should be noted that if the LM mode is not included in availablemodes for chroma component intra prediction, the TU code word having themaximum value 2 is not parsed from the bitstream; instead, a binary flagis extracted from the bitstream according to the method in theembodiment 300. If the current block chroma mode is determined as a DMmode according to the binary flag, end the mode determining procedure;otherwise, perform step 42.

42. Extract second information.

Similar to step 330, the entropy decoding method described in theembodiment 300 is used to extract the second information from thebitstream. The second information is an FL code word having a length of2.

43. Determine a remaining mode according to the second information, anduse the remaining mode as a current block chroma mode.

Similar to 340 in the embodiment 300, the current block chroma mode isdetermined according to a corresponding relationship between the FL codeword and the remaining mode. One available corresponding relationship isdescribed above.

Alternatively, in step 44, if a current block luma mode is the same asthe current block chroma mode determined from the remaining modesaccording to the above method, a replacement mode is used to replace thecurrent block chroma mode used in step 43. A mode which is differentfrom all modes in a chroma component intra prediction mode set may beselected as the replacement mode. For example, a directional predictionmode from upper-right to lower-left may be used as the replacement mode.When the current block luma mode is not the same as the current blockchroma mode determined from the remaining modes according to the abovemethod, the current block chroma mode used in step 43 remains unchanged.

After the current block chroma mode is determined, the mode determiningprocedure may be ended.

In addition, similar to the embodiment 300, in order to remove aredundancy in available prediction modes for a chroma component,alternatively, the set of available prediction modes for the chromacomponent used in the embodiment may also include only three chromacomponent prediction modes, that is, a DM mode, an LM mode, and adefault mode. Correspondingly, as shown in FIG. 4, step 45 may also beused to replace steps 42 and 43 while other steps remain unchanged. Insuch cases, it is known according to the previous steps that the currentblock chroma mode is neither the DM mode nor the LM mode.

45. Use a default mode as the current block chroma mode.

The embodiment of the present invention may reduce the encodinginformation of a chroma mode and optimize sorting for the information toreduce encoding or decoding steps, thereby reducing encoding or decodingcomplexity and improving decoding efficiency.

FIG. 5 is a schematic block diagram of an encoding or decoding apparatus50 according to an embodiment of the present invention. The apparatus 50includes a first extracting unit 51, a first determining unit 52, asecond extracting unit 53, and a second determining unit 54.

The first extracting unit 51 is configured to extract first informationin a bitstream.

The first determining unit 52 is configured to determine a chromacomponent intra prediction mode according to the first informationextracted by the first extracting unit 51.

The second extracting unit 53 is configured to, when the firstdetermining unit 51 cannot determine the chroma component intraprediction mode according to the first information, extract secondinformation in the bitstream.

The second determining unit 54 is configured to determine the chromacomponent intra prediction mode according to the second informationextracted by the second extracting unit 53.

The apparatus 50 implements methods 20 and 300, where the specificdetails are not described repeatedly herein.

The embodiment of the present invention may reduce the encodinginformation of a chroma mode and optimize sorting for the information toreduce encoding or decoding steps, thereby reducing encoding or decodingcomplexity and improving decoding efficiency.

In addition, alternatively, when the first information extracted by thefirst extracting unit 51 includes DM information carried by a binaryflag, where the DM information is used to indicate whether the chromacomponent intra prediction mode is a DM mode, the first determining unit52 is specifically configured to, when the DM information indicates thatthe chroma component intra prediction mode is a DM mode, use the DM modeas the chroma component intra prediction mode.

Alternatively, when the first information extracted by the firstextracting unit 51 includes DM information carried by a binary flag,where the DM information is used to indicate whether the chromacomponent intra prediction mode is a DM mode, the first determining unit52 is specifically configured to, when the DM information indicates thatthe chroma component intra prediction mode is not a DM mode, use adefault mode as the chroma component intra prediction mode, where thedefault mode is one of predefined luma component intra prediction modes.

Alternatively, when the first information extracted by the firstextracting unit 51 includes DM information carried by a binary flag,where the DM information is used to indicate whether the chromacomponent intra prediction mode is a DM mode, the second extracting unit53 is specifically configured to, when the first determining unit 52determines that the DM information indicates that the chroma componentintra prediction mode is not a DM mode, extract second information inthe bitstream, and the second determining unit 54 is specificallyconfigured to determine the chroma component intra prediction modeaccording to the second information extracted by the second extractingunit 51.

Alternatively, when the DM information of the first informationextracted by the first extracting unit 51 indicates that the chromacomponent intra prediction mode is not a DM mode, and the firstinformation further includes LM information carried by a binary flag,where the LM information is used to indicate whether the chromacomponent intra prediction mode is an LM mode, the first determiningunit 52 is specifically configured to, when it is determined that the LMinformation indicates that the chroma component intra prediction mode isan LM mode, use the LM mode as the chroma component intra predictionmode.

Alternatively, when the DM information of the first informationextracted by the first extracting unit 51 indicates that the chromacomponent intra prediction mode is not a DM mode, and the firstinformation further includes LM information carried by a binary flag,where the LM information is used to indicate whether the chromacomponent intra prediction mode is an LM mode, the first determiningunit 52 is specifically configured to, when it is determined that the LMinformation indicates that the chroma component intra prediction mode isnot an LM mode, use a default mode as the chroma component intraprediction mode, where the default mode is one of predefined lumacomponent intra prediction modes.

Alternatively, when the DM information of the first informationextracted by the first extracting unit 51 indicates that the chromacomponent intra prediction mode is not a DM mode, and the firstinformation further includes LM information carried by a binary flag,where the LM information is used to indicate whether the chromacomponent intra prediction mode is an LM mode, the second extractingunit 53 is specifically configured to extract second information in thebitstream when the first determining unit 52 determines that the

LM information indicates that the chroma component intra prediction modeis not an LM mode, and the second determining unit 54 is specificallyconfigured to determine the chroma component intra prediction modeaccording to the second information extracted by the second extractingunit 53.

Alternatively, when the first extracting unit 51 extracts the firstinformation carried by a truncated unary (TU) code having a maximumvalue 2, the first determining unit 52 is specifically configured to,when it is determined that the TU code indicates that the chromacomponent intra prediction mode is a DM mode, use the DM mode as thechroma component intra prediction mode.

Alternatively, when the first extracting unit 5 specifically extractsthe first information carried by a TU code having a maximum value 2, thefirst determining unit 52 is specifically configured to, when it isdetermined that the TU code indicates that the chroma component intraprediction mode is an LM mode, use the LM mode as the chroma componentintra prediction mode.

Alternatively, when the first extracting unit 51 extracts the firstinformation carried by a TU code having a maximum value 2, the firstdetermining unit 52 is specifically configured to, when it is determinedthat the TU code indicates that the chroma component intra predictionmode is neither a DM mode nor an LM mode, use a default mode as thechroma component intra prediction mode, where the default mode is one ofpredefined luma component intra prediction modes.

Alternatively, when the first extracting unit 51 extracts the firstinformation carried by a TU code having a maximum value 2, the secondextracting unit 53 is specifically configured to extract secondinformation in the bitstream when the first determining unit 52determines that the TU code indicates that the chroma component intraprediction mode is neither a DM mode nor an LM mode, and the seconddetermining unit 54 is specifically configured to determine the chromacomponent intra prediction mode according to the second informationextracted by the second extracting unit 53.

Alternatively, when the second extracting unit 51 extracts the secondinformation carried by a fixed-length (FL) code, the second determiningunit 53 is specifically configured to determine a remaining mode byusing the FL code, and use the remaining mode as the chroma componentintra prediction mode. The second extracting unit 51 may extract thesecond information carried by one FL code by using an equiprobability(by-pass) mode.

FIG. 6 is a schematic block diagram of another encoding or decodingapparatus 60 according to an embodiment of the present invention. As animplementation manner, the apparatus 60 includes a first extracting unit61, a first determining unit 62, a second extracting unit 63, a seconddetermining unit 64, which are the same as or similar to the firstextracting unit 51, the first determining unit 52, the second extractingunit 53, and the second determining unit 54 of the apparatus 50. Thedifference lies in that the apparatus 60 may further include a thirddetermining unit 65 and/or a fourth determining unit 66.

The first extracting unit 61 is configured to extract first informationin a bitstream.

The first determining unit 62 is configured to determine a chromacomponent intra prediction mode according to the first informationextracted by the first extracting unit 61.

The second extracting unit 63 is configured to, when the firstdetermining unit 61 cannot determine the chroma component intraprediction mode according to the first information, extract secondinformation in the bitstream,

The second determining unit 64 is configured to determine the chromacomponent intra prediction mode according to the second informationextracted by the second extracting unit 63.

The third determining unit 65 is configured to determine whether achroma component intra prediction mode set includes an LM mode.

When the third determining unit 65 determines that the chroma componentintra prediction mode set does not include the LM mode, the firstinformation extracted by the first extracting unit 61 includes onlyinformation for indicating whether the chroma component intra predictionmode is a DM mode. Alternatively, when the third determining unit 65determines that the chroma component intra prediction mode set includesthe LM mode, the first information extracted by the first extractingunit 61 includes information for indicating whether the chroma componentintra prediction mode is a DM mode or an LM mode.

The fourth determining unit 66 is configured to, when the determinedchroma component intra prediction mode is neither the DM mode nor the LMmode, determine whether a luma component intra prediction mode is thesame as the determined chroma component intra prediction mode.

When the fourth determining unit 66 determines that the luma componentintra prediction mode is the same as the determined chroma componentintra prediction mode, a replacement mode is used to replace thedetermined chroma component intra prediction mode, where the replacementmode is one of modes that are different from the modes in the chromacomponent intra prediction mode set. Alternatively, when the fourthdetermining unit 66 determines that the luma component intra predictionmode is not the same as the determined chroma component intra predictionmode, the determined chroma component intra prediction mode remainsunchanged.

The apparatus 60 implements methods 20 and 300, where the specificdetails are not described repeatedly herein.

The embodiment of the present invention may reduce the encodinginformation of a chroma mode and optimize sorting for the information toreduce encoding or decoding steps, thereby reducing encoding or decodingcomplexity and improving decoding efficiency.

A person of ordinary skill in the art may be aware that units andalgorithm steps of the examples described with reference to theembodiments disclosed herein may be implemented by using electronichardware or a combination of computer software and electronic hardware.These functions may be executed in a mode of hardware or softwaredepending on a specific application design constraint condition of thetechnical solutions. A person skilled in the art may use differentmethods for each specific application to implement the describedfunctions; however, this implementation shall not be deemed as exceedingthe scope of the present invention.

A person skilled in the art should clearly understand that, for theconvenience and brevity of description, for the specific operationprocesses of the above system, apparatus, and units, reference may bemade to the corresponding processes in the method methods, and detailsare not described repeatedly here.

In the embodiments provided the present application, it should beunderstood that the system, apparatus, and method disclosed may beimplemented in other forms. For example, the apparatus embodimentdescribed above is merely illustrative. For example, the division ofunits is merely logical functional division, and there are otherdivision forms in real application. For example, multiple units orcomponents may be combined or be integrated to another system, or somefeatures may be ignored or not be executed. In another aspect, thecoupling, direct coupling, or communication connection therebetweenwhich is displayed or discussed may be indirect coupling orcommunication connection of interfaces, apparatuses, or units, and maybe electrical, mechanical, or in other forms.

The units described as separate components may be or may be notphysically separate, and the components displayed as units may be or maybe not physical units, and may be located in one place or be distributedon multiple network units. Part or all units may be selected dependingon the actual requirements to realize the objectives of the solutionsaccording to the embodiments.

In addition, the functional units in embodiments of the presentinvention may be integrated in one processing unit or exist separatelyas physical units, or two or more units may be integrated in one unit.

The functions may be implemented in a mode of software functional unitsand sold or used as an independent product, which may be stored in acomputer readable storage medium. Based on such understanding, theessence of the technical solutions of the present invention or the partthat makes a contribution to the prior art may be implemented in theform of software product. The computer software product is stored in astorage medium, and includes multiple instructions to enable a computerequipment (which may be a personal computer, a server, or a networkequipment) to execute all or partial steps of the method described inembodiments of the present invention. The storage medium includesvarious media which can store program codes such as a USB flash drive, amobile hard disk, a read-only memory (Read-Only Memory, ROM), a randomaccess memory (Random Access Memory, RAM), a magnetic disk, or anoptical disk.

The solutions provided by the embodiments of the present invention maybe applied in a digital signal processing field, and be implemented byusing a video encoder and a decoder. A video encoder and decoder may bewidely used in various communication devices or electronic devices, suchas a media gateway, mobile phone, wireless device, personal digitalassistant (PDA, Personal Data Assistant), hand-held or portablecomputer, GPS (Global Positioning System, global positioning system)receiver/navigator, camera, video player, video camera, video recorder,and monitoring device. These devices include processor, a storage, andan interface for transferring data. The video encoder and decoder may beimplemented directly by using a digital circuit or chip, such as a DSP(Digital Signal Processor, digital signal processor), or be implementedby using software code to drive a processor to execute a procedure inthe software code.

The foregoing description is merely about the specific embodiments ofthe present invention, but is not intended to limit the protection scopeof the present invention. Any variation or replacement readily figuredout by a person skilled in the art within the technical scope disclosedin the present invention shall fall within the protection scope of thepresent invention. Therefore, the protection scope of the presentinvention shall be subject to the protection scope of the claims.

What is claimed is:
 1. A decoding method, the method comprising:extracting first information in a bitstream; determining a chromacomponent intra prediction mode value for a current block according tothe first information, wherein the first information comprisesinformation for indicating whether the chroma component intra predictionmode value is corresponding to a DM mode; when the chroma componentintra prediction mode value cannot be determined according to the firstinformation, extracting second information in the bitstream, wherein thesecond information is carried by an FL code having 2 binary symbols;determining the chroma component intra prediction mode value accordingto the second information, wherein the second information is used toindicate a remaining mode value of the chroma component intra predictionmode values, and the remaining mode value is corresponding to one ofavailable chroma component intra prediction mode other than the DM mode;and determining a chroma intra prediction mode for the current blockaccording to the determined chroma component intra prediction mode valueand a luma intra prediction mode for the current block.
 2. The methodaccording to claim 1, when the first information is carried by atruncated unary TU code with a maximum value
 1. 3. The method accordingto claim 1, wherein, the DM mode indicates that the chroma intraprediction mode for the current block is the same to the luma intraprediction mode for the current block.
 4. The method according to claim1, wherein extracting the second information in the bitstream comprisesextracting the FL code in the bitstream by using an equiprobabilityby-pass mode.
 5. The method according to claim 1, wherein the FL codehaving 2 binary symbols comprises words 00, 01, 10, or 11, each of whichis used to indicate a remaining mode of the chroma component intraprediction mode respectively.
 6. The method according to claim 1,wherein the one of available chroma component intra prediction modescomprises DC mode, Vertical mode, Horizontal mode or Planar mode.
 7. Themethod according to claim 2, wherein when the truncated unary TU code is0, the first information indicating the chroma component intraprediction mode value is corresponding to a DM mode.
 8. A decodingapparatus, the apparatus comprising: a first extracting unit, configuredto extract first information in a bitstream; a first determining unit,configured to determine a chroma component intra prediction mode valuefor a current block according to the first information extracted by thefirst extracting unit, the first information comprises information forindicating whether the chroma component intra prediction mode value iscorresponding to a DM mode; a second extracting unit, configured to,when the first determining unit fails to determine the chroma componentintra prediction mode value according to the first information, extractsecond information in the bitstream, wherein the second information iscarried by an FL code having 2 binary symbols; a second determiningunit, configured to determine the chroma component intra prediction modevalue according to the second information extracted by the secondextracting unit, wherein the second information is used to indicate aremaining mode value of the chroma component intra prediction modevalue, the remaining mode value is corresponding to one of availablechroma component intra prediction modes other than the DM mode; and achroma intra prediction mode determining unit, configured to determine achroma intra prediction mode for the current block according to thedetermined chroma component intra prediction mode value and a luma intraprediction mode for the current block
 9. The apparatus according toclaim 8, wherein the first information is carried by a truncated unaryTU code with a maximum value
 1. 10. The apparatus according to claim 8,wherein the DM mode indicates that the chroma intra prediction mode forthe current block is the same to the luma intra prediction mode for thecurrent block.
 11. The apparatus according to claim 8, wherein thesecond extracting unit is configured to extract the second informationcarried by one FL code by using an equiprobability by-pass mode.
 12. Theapparatus according to claim 8, wherein the FL code having 2 binarysymbols comprises words 00, 01, 10, or 11, each of which is used toindicate a remaining mode value of the chroma component intra predictionmode respectively.
 13. The apparatus according to claim 8, wherein theone of available chroma component intra prediction modes comprises DCmode, Vertical mode, Horizontal mode or Planar mode.
 14. The methodaccording to claim 9, wherein when the truncated unary TU code is 0, thefirst information indicating the chroma component intra prediction modevalue is corresponding to a DM mode.